package com.ad_hccm.dao.Appendix;

import com.ad_hccm.domain.Appendix.SuspendExperiment;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * TODO 中止实验
 */
@Mapper
public interface SuspendExperimentDao {
    @Insert("insert into suspend_experiment value(#{id}, #{date}, #{reason}, #{seriousAdverseReaction}, #{poorTherapeuticEffect}, #{programmeGrossFault}, #{implementImportantDeviations}, #{fundingReason}, #{managementReason})")
    public boolean save(SuspendExperiment domain);

    @Update("update suspend_experiment set date = #{date}, reason = #{reason}, seriousAdverseReaction = #{seriousAdverseReaction}, poorTherapeuticEffect = #{poorTherapeuticEffect}, programmeGrossFault = #{programmeGrossFault}, implementImportantDeviations = #{implementImportantDeviations}, fundingReason = #{fundingReason}, managementReason = #{managementReason} where id=#{id}")
    public boolean update(SuspendExperiment domain);

    @Select("select * from suspend_experiment where id=#{id}")
    public SuspendExperiment getById(String id);

    @Select("select * from suspend_experiment")
    public List<SuspendExperiment> getAll();

    @Delete("delete from suspend_experiment where id=#{id}")
    public boolean delete(String id);
}